Almost all functions implemented