Added type signatures to functions