replaced self with f
removed unused variable