reworked lock func structure to allow for function pointering. up next: doing that