Clean up code + fix bubble bug