made fps code nicer allocation wise