new code to abstract allegro for nicer object oriented handling