Added specs, types and some functions.