updated with bugs