fixed some critical bugs and added a thrid color