added som helper functions. redid some types