custom main stack constructor