Threw in a buncha subscripts, cleaned up code