condensed remainder of code