The castle-looking building is the Waag, the old weighing house for goods brought in from the IJ.