reformatted, cut out unnecessary code. implemented evan's %3 suggestion.