add a simplified main function

also get dependencies better
more flex