added free functions