implementing a simple bubble sort