added functions, fixed make, added c compilation in top level