removed unnecessary code,different approach again