some formatting things. minor logic improvement. nothing cray.