made some changes.. Still incomplete