fixing some display errors. not pretty yet, but it seems to function