Last version of the code, still need changes