modified...some bugs exist maybe.