updated syntax
cast cocoa integers to avoid warnings