Big commit: first working version