Added stack overflow and some design tweaks