first draft of brute force algorithim