added basic bubble logic