use compile function to organize outputs a little beeter