Edited to make it compilable