First version, working but not good