First draft of prim's algo