removed unused variable
moved #ifdef section into a block to prevent warning about mixing code and declarations