uncommented workign portion, commented out in progress portions