refactored hanles; proper locking (not purchase and updates concurrently); nice code layout :)
merged