refactored random access a bit