First version. Everything implemented