some code and stuff from bma