working but with bugs