Added owner attribute to castle and stack classes