Working on better exception handling [BROKEN COMPILE]