simplified method
removed unused variable