Initial implementation, needs test and documentation