the code which is actually more general than required