Changed controller to be compatible with more keys (using boolean array)