Woo, code almost might be functional (lol)