Made it compilable, added checkbox