added load bar, began defining functions