Started stack calc code