Implemented vision in new main function