Basic implementation waiting to debug

This is just a rough implementation without any validation of operation.