Starting to flesh out main logic