Fixed bug, first working version