dumb min function fleshed out