organized main into procedural functions for now