added loader bar & drawing functions