tidied up and made 2 server calls for a ave and screen refresh (which i think is better)