Reverting previous commit due to bugs