removed complicated code and got back to simple code