modified to use optional argument bits for retrieving auto allocated value