Then I'd recommend taking a look the example code and rewrite yours to match it.