first version with bugs