Rewritten + added more methods.