Added key parsing and remaining functions. needs testing.