make code work standalone